libmystdio.so:my_string.o my_stdio.o
	gcc -o $@ $^ -shared
	@echo "$^ to .so ..done"
%.o:%.c
	@gcc -c $< -fPIC
	@echo "$^ to $@"
.PHONY:clean
clean:
	rm -rf *.o *.so *.txt *.out
.PHONY:output
output:
	@mkdir other 
	@mkdir stdc
	@mkdir ./stdc/lib
	@mkdir ./stdc/include
	@cp *.so ./stdc/lib 
	@cp *.h ./stdc/include
	@tar -czf stdc.tgz ./stdc
	@cp stdc.tgz ./other
	@cp main.c ./other
	@echo "output to other ... done"
.PHONY:del
del:
	rm -rf stdc* other

#静态库
#libmystdio.a:my_string.o my_stdio.o
#	@ar -rc $@ $^
#	@echo "$^ to .a ..done"
#%.o:%.c
#	@gcc -c $<
#	@echo "$^ to $@"
#.PHONY:clean
#clean:
#	rm -rf *.o *.a *.txt *.out
#.PHONY:output
#output:
#	@mkdir other 
#	@mkdir stdc
#	@mkdir ./stdc/lib
#	@mkdir ./stdc/include
#	@cp *.a ./stdc/lib 
#	@cp *.h ./stdc/include
#	@tar -czf stdc.tgz ./stdc
#	@cp stdc.tgz ./other
#	@cp main.c ./other
#	@echo "output to other ... done"
#.PHONY:del
#del:
#	rm -rf stdc* other
